package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.aliyuncs.exceptions.ClientException;
import com.itheima.constant.MessageConstant;
import com.itheima.constant.RedisMessageConstant;
import com.itheima.entity.Result;
import com.itheima.pojo.Order;
import com.itheima.pojo.Repository;
import com.itheima.pojo.Sport;
import com.itheima.service.InterveneService;
import com.itheima.service.OrderService;
import com.itheima.utils.SMSUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.JedisPool;

import java.util.List;
import java.util.Map;

/**
 * 体检预约
 */
@RestController
@RequestMapping("/intervene")
public class InterveneController {
    @Reference
    private InterveneService interveneService;

    //根据预约id查询预约信息
    @RequestMapping("/findSportByLevelId")
    public List<Sport> findSportByLevelId(Integer id,Integer levelId){
        List<Sport> sports = interveneService.findInterveneByLevelId(levelId);
        return sports;
    }

    @RequestMapping("/findMealByLevelId")
    public List<Repository> findMealByLevelId(Integer levelId){
        List<Repository> repositories = interveneService.findMealByLevelId(levelId);
        return repositories;
    }

}
